package com.chukun.search.services;

import com.chukun.search.base.ServiceMultiResult;
import com.chukun.search.base.ServiceResult;
import com.chukun.search.dto.HouseBucketDTO;
import com.chukun.search.form.MapSearch;
import com.chukun.search.form.RentSearch;

import java.util.List;

public interface ISearchService {

    /**
     * 索引目标房源
     * @param houseId
     */
    void createHouseIndex(Long houseId);

    /**
     * 移除房源索引
     * @param houseId
     */
    void removeHouseIndex(Long houseId);

    /**
     * 从es上查询houseId
     * @param rentSearch
     * @return
     */
    ServiceMultiResult<Long> queryHouseIdWithEs(RentSearch rentSearch);

    /**
     * 搜索提示词
     */
    ServiceResult<List<String>> suggest(String prefix);

    /**
     * 计算小区的房源数
     * @param enCityName
     * @param enRegionName
     * @param district
     * @return
     */
    ServiceResult<Long> aggregateDistrictHouse(String enCityName,String enRegionName,String district);

    /**
     * 根据城市名称，获取房源信息
     * @param cityEnName
     * @return
     */
    ServiceMultiResult<HouseBucketDTO>  mapAggregation(String cityEnName);

    /**
     * 整个地图查询
     * @param cityEnName
     * @param orderBy
     * @param orderDirection
     * @param start
     * @param size
     * @return
     */
    ServiceMultiResult<Long> mapQuery(String cityEnName, String orderBy, String orderDirection, int start, int size);

    /**
     * 经纬度查询
     * @param mapSearch
     * @return
     */
    ServiceMultiResult<Long> boundMapQuery(MapSearch mapSearch);
}
